import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[3*n];
        for (int i = 0; i < 3*n; i++) {
            array[i] = sc.nextInt();
        }
        for (int i = 0; i < 3*n; i++) {
            for (int j = i + 1; j < 3 * n; j++) {
                if (array[i] > array[j]) {
                    int tmp = array[i];
                    array[i] = array[j];
                    array[j] = tmp;
                }
            }
        }

            int sum = 0;
            int count = n;
            int k = 3*n-n-1;
            while (count > 0) {
                sum += array[k--];
                count--;
            }
            System.out.println(sum);
    }
}
